﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IterationLife.Domains.Sports.Dtos.ZeppDatas;

namespace IterationLife.Domains.Sports.Dtos.ZeppSports
{
    public class ZeppGather
    {
        /// <summary>
        /// 总距离
        /// </summary>
        public decimal? totalDistance { get; set; }
        /// <summary>
        /// 散步距离
        /// </summary>
        public decimal? walkDistance { get; set; }
        /// <summary>
        /// 慢跑距离
        /// </summary>
        public decimal? runDistance { get; set; }
        /// <summary>
        /// 冲刺距离
        /// </summary>
        public decimal? sprintDistance { get; set; }
        /// <summary>
        /// 按时间段统计的移动距离, 每隔5分钟一次统计，单位米
        /// </summary>
        public List<decimal> distanceWithTime { get; set; }
        /// <summary>
        /// 按时间段统计的触球次数, 数组，每隔5分钟一次统计
        /// </summary>
        public List<decimal> kicksWithTime { get; set; }
        /// <summary>
        /// 按时间段统计的冲刺次数, 数组，每隔5分钟一次统计
        /// </summary>
        public List<decimal> sprintsWithTime { get; set; }
        /// <summary>
        /// 总触球次数
        /// </summary>
        public decimal? kicks { get; set; }
        /// <summary>
        /// 运球次数
        /// </summary>
        public decimal? dribbles { get; set; }
        /// <summary>
        /// long，防守次数
        /// </summary>
        public decimal? defenses { get; set; }
        /// <summary>
        /// 扑救次数
        /// </summary>
        public decimal? saves { get; set; }
        /// <summary>
        /// 总冲刺次数
        /// </summary>
        public decimal? sprints { get; set; }
        /// <summary>
        /// 进球个数
        /// </summary>
        public decimal? goals { get; set; }
        /// <summary>
        /// 射门次数
        /// </summary>
        public decimal? shots { get; set; }
        /// <summary>
        /// 最大奔跑速度，单位Km/H
        /// </summary>
        public decimal? maxSpeed { get; set; }
        /// <summary>
        /// 最大击球速度，单位Km/H
        /// </summary>
        public decimal? maxKickSpeed { get; set; }
    }

    public static class ZeppGatherExtension
    {
        /// <summary>
        /// 转换
        /// </summary>
        public static ZeppGatherData ToZeppGatherData(this ZeppGather zeppGather)
        {
            var result = new ZeppGatherData();
            SetEntity(zeppGather, result);
            return result;
        }

        /// <summary>
        /// 设置对象
        /// </summary>
        public static void SetEntity(ZeppGather zeppGather, ZeppGatherData zeppGatherData)
        {
            zeppGatherData.TotalDistance = zeppGather.totalDistance;
            zeppGatherData.WalkDistance = zeppGather.walkDistance;
            zeppGatherData.RunDistance = zeppGather.runDistance;
            zeppGatherData.SprintDistance = zeppGather.sprintDistance;
            zeppGatherData.DistanceWithTime = zeppGather.distanceWithTime;
            zeppGatherData.KicksWithTime = zeppGather.kicksWithTime;
            zeppGatherData.SprintsWithTime = zeppGather.sprintsWithTime;

        }
    }
}

//public string userId { get; set; }
//public decimal? totalDistance { get; set; }
//public decimal? walkDistance { get; set; }
//public decimal? runDistance { get; set; }
//public decimal? sprintDistance { get; set; }
//public List<decimal?> distanceWithTime { get; set; }
//public List<decimal?> kicksWithTime { get; set; }
//public List<decimal?> sprintsWithTime { get; set; }
//public decimal? kicks             { get; set; }
//public decimal? dribbles           { get; set; }
//public decimal? defenses       { get; set; }
//public decimal? saves              { get; set; }
//public decimal? sprints             { get; set; }
//public decimal? goals                      { get; set; }
//public decimal? shots                      { get; set; }
//public decimal? maxSpeed                         { get; set; }
//public decimal? maxKickSpeed       { get; set; }
//public decimal? activeTime { get; set; }
//public decimal? preferredFoot { get; set; }
//public decimal? scoreOurs { get; set; }
//public decimal? scoreTheirs { get; set; }